hikey960: fix invoking driver init in image load driver
authorHaojian Zhuang <[email protected]>
Tue, 30 Jan 2018 02:35:17 +0000 (10:35 +0800)
committerHaojian Zhuang <[email protected]>
Mon, 5 Mar 2018 05:05:42 +0000 (13:05 +0800)
It's unnecessary to call platform driver initialization in image
load driver. We could make bl2_platform_setup() to executing
just before SCP_BL2 by setting flag IMAGE_ATTRIB_PLAT_SETUP.

Signed-off-by: Haojian Zhuang <[email protected]>
plat/hisilicon/hikey960/hikey960_bl2_setup.c
plat/hisilicon/hikey960/hikey960_image_load.c
plat/hisilicon/hikey960/hikey960_private.h

index d443d8e83e01d84bb6d8984d6e0d093db63c0fae..50bc7f0a8c50aae20daa3421bdc6fcd9cce23784 100644 (file)
@@ -157,7 +157,7 @@ static void hikey960_ufs_reset(void)
        } while (data & PERI_UFS_BIT);
 }
 
-void hikey960_init_ufs(void)
+static void hikey960_init_ufs(void)
 {
        dw_ufs_params_t ufs_params;
 
@@ -747,4 +747,6 @@ void bl2_platform_setup(void)
        hikey960_tzc_init();
        hikey960_peri_init();
        hikey960_pinmux_init();
+       hikey960_init_ufs();
+       hikey960_io_setup();
 }
index 8e91adbf2e4c9e768da92905ddee7d1d069b3ed0..ad7be5081d604866025af0a39ab3dc14afd678af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -8,8 +8,6 @@
 #include <desc_image_load.h>
 #include <platform.h>
 
-#include "hikey960_private.h"
-
 /*******************************************************************************
  * This function flushes the data structures so that they are visible
  * in memory for the next BL image.
@@ -24,10 +22,6 @@ void plat_flush_next_bl_params(void)
  ******************************************************************************/
 bl_load_info_t *plat_get_bl_image_load_info(void)
 {
-       /* Required before loading scp_bl2 */
-       hikey960_init_ufs();
-       hikey960_io_setup();
-
        return get_bl_load_info_from_mem_params_desc();
 }
 
index e3c9d2153b2d3c39aa544b4c37d4b34972d8df4b..8f2a842e2b005c0b6e2999730e60caa13b76a8bb 100644 (file)
@@ -24,7 +24,6 @@ void hikey960_init_mmu_el3(unsigned long total_base,
                        unsigned long ro_limit,
                        unsigned long coh_start,
                        unsigned long coh_limit);
-void hikey960_init_ufs(void);
 void hikey960_io_setup(void);
 int hikey960_read_boardid(unsigned int *id);
 void set_retention_ticks(unsigned int val);